package com.txx.app.main.modules.web.function;

import android.content.Intent;
import com.qihoo360.replugin.RePlugin;
import com.txx.app.main.App;
import com.txx.app.main.BuildConfig;
import com.txx.app.main.modules.web.WebCommonFragment;
import com.txx.app.main.modules.web.js.H5BasePlugin;
import com.txx.app.main.modules.web.js.H5Event;

/**
 * created by houyl
 * on  6:51 PM
 */
public class JumpToCustom extends H5BasePlugin {

    @Override
    public boolean handleEvent(H5Event h5Event, WebCommonFragment fragment) {
        if (h5Event == null) {
            return false;
        }
        if (App.isOA) {
            //内勤
            Intent intent_custom = RePlugin.createIntent("app.custom", "com.txx.app.custom.module.custom.ui.CustomerManagerActivity");
            intent_custom.putExtra("id", App.staffBuidler);
            RePlugin.startActivity(fragment.getContext(), intent_custom);
        } else {
            //外勤
            Intent intent = RePlugin.createIntent("app.webview", "com.txx.app.webview.ui.H5WebActivity");
            intent.putExtra("url", BuildConfig.DX_CUSTOM_CENTER_URL);
            RePlugin.startActivity(fragment.getContext(), intent);
        }
        return true;
    }

    @Override
    public void onRelease() {

    }

    @Override
    public String getCallBackName() {
        return null;
    }




}
